package cate.game.role.res.guild.po.my.skill.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdGuild;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "公会技能升级的请求")
@OperationSetter(value = GDOperation.GUILD_UPGRADE_SKILL)
public class GuildUpgradeSkillReq implements MsgInput {

    @NoteField(value = "职业")
    public byte job;

    @NoteField(value = "公会技能类型")
    public byte type;

    @NoteField(value = "顺序")
    public int order;

    @Override
    public MsgConfig conf() {
        return MsgIdGuild.GUILD_UPGRADE_SKILL_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        if (!cc.getRole().getRes().guild.checkGuild().ok()) {
            game.notice.message(cc.getRole(), "尚未加入协会");
            return;
        }
        cc.getRole().getRes().guild.skill.upgradeSkill(type, order, job);
    }
}
